public class Solution {
    public boolean isPalindrome(int x) {
        if(x < 0){
            return false;
        }
        String cur = String.valueOf(x);
        int left = 0;
        int right = cur.length()-1;
        while (left < right){
            if(cur.charAt(left) != cur.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
            return true;
    }
}
